# name : Generates all combinations of the indices in macro
# key : allcombi.indice.macro.
# contributor: Shuguang Sun
# --
%macro test;
   %let x1=0;
   %let x2=0;
   %let x3=0;
   %let add=0;
   %let remove=0;
   %let n=5;
   %let k=3;
   %let ncomb=%sysfunc(comb(&n, &k));
   %do j=1 %to &ncomb;
      %syscall allcombi(n, k, x1, x2, x3, add, remove);
      %let jfmt=%qsysfunc(putn(&j, 5.));
      %put &jfmt: &x1 &x2 &x3 add=&add remove=&remove;
   %end;
%mend;
%test